#ifndef PERSON_H
#define PERSON_H

#include <string>
#include <iostream>

class Person
{
    friend std::istream &read(std::istream &is, Person &person);
    friend std::ostream &print(std::ostream &os, const Person &person);
private:
    std::string strName;  // 姓名
    std::string strAddress;  // 地址
public:  // 构造函数
    Person() = default;
    Person(const std::string &name, const std::string &add)
    {
        strName = name;
        strAddress = add;
    }
    Person(std::istream &is);
public:
    std::string getName() const { return strName; }
    std::string getAddress() const { return strAddress; }
};

std::istream &read(std::istream &is, Person& person);
std::ostream &print(std::ostream &os, const Person& person);

#endif // PERSON_H
